import Vue from "vue";
import Router from "vue-router";
const PcIndex = () => import("@/view/pcfile/pc_index");
const AllRooms = () => import("@/view/pcfile/allRooms");
const Manager = () => import("@/view/pcfile/manager");
const Details = () => import("@/view/pcfile/details");
const loan = () => import("@/view/pcfile/loan");
const my = () => import("@/view/pcfile/my");
const Map = () => import("@/view/pcfile/map");
const One_stop = () => import("@/view/pcfile/one_stop");
const Broker = () => import("@/view/pcfile/broker");
const Contact = () => import("@/view/pcfile/contact");
const Understand = () => import("@/view/pcfile/understand");
const Service = () => import("@/view/pcfile/service");

const Aboutus = () => import("@/view/pcfile/aboutUs");
const MIndex = () => import("@/view/m_index");
const AllHome = () => import("@/view/mfile/all_home");
const MDetails = () => import("@/view/mfile/mdetails");
const Mloan = () => import("@/view/mfile/mloan");
const Introduce = () => import("@/view/mfile/introduce");
const MaboutUs = () => import("@/view/mfile/maboutUs");
const Subscribe = () => import("@/view/mfile/subscribe");
const Helpme = () => import("@/view/mfile/helpme");
const M_my = () => import("@/view/mfile/m_my");
const M_myList = () => import("@/view/mfile/m_myList");
const Modify_data = () => import("@/view/mfile/modify_data");
const M_sign = () => import("@/view/mfile/m_sign");
const M_map = () => import("@/view/mfile/m_map");
const M_stop = () => import("@/view/mfile/m_stop");
const M_broker = () => import("@/view/mfile/m_broker");
const M_contact = () => import("@/view/mfile/m_contact");
const M_understand = () => import("@/view/mfile/m_understand");
const M_service = () => import("@/view/mfile/m_service");
const M_manager = () => import("@/view/mfile/m_manager");

Vue.use(Router);

const originalPush = Router.prototype.push;

Router.prototype.push = function push(location) {
  return originalPush.call(this, location).catch(err => err);
};

export default new Router({
  mode: "history",
  base: process.env.BASE_URL,
  scrollBehavior(to, from, savedPosition) {
    return { x: 0, y: 0 };
  },
  routes: [
    {
      path: "/pc_index",
      name: "PcIndex",
      component: PcIndex
    },
    {
      path: "/allRooms",
      name: "AllRooms",
      component: AllRooms
    },
    {
      path: "/manager",
      name: "Manager",
      component: Manager
    },
    {
      path: "/details",
      name: "Details",
      component: Details
    },
    {
      path: "/loan",
      name: "loan",
      component: loan
    },
    {
      path: "/map",
      name: "Map",
      component: Map
    },
    {
      path: "/contact",
      name: "Contact",
      component: Contact
    },
    {
      path: "/my",
      name: "my",
      component: my
    },
    {
      path: "/aboutUs",
      name: "Aboutus",
      component: Aboutus
    },
    {
      path: "/one_stop",
      name: "One_stop",
      component: One_stop
    },
    {
      path: "/broker",
      name: "Broker",
      component: Broker
    },
    {
      path: "/service",
      name: "Service",
      component: Service
    },

    {
      path: "/understand",
      name: "Understand",
      component: Understand
    },
    {
      path: "/m_index",
      name: "MIndex",
      component: MIndex
    },
    {
      path: "/all_home",
      name: "AllHome",
      component: AllHome
    },
    {
      path: "/mdetails",
      name: "MDetails",
      component: MDetails
    },
    {
      path: "/mloan",
      name: "Mloan",
      component: Mloan
    },
    {
      path: "/introduce",
      name: "Introduce",
      component: Introduce
    },
    {
      path: "/maboutUs",
      name: "MaboutUs",
      component: MaboutUs
    },
    {
      path: "/subscribe",
      name: "Subscribe",
      component: Subscribe
    },
    {
      path: "/helpme",
      name: "Helpme",
      component: Helpme
    },
    {
      path: "/m_my",
      name: "M_my",
      component: M_my
    },
    {
      path: "/m_myList",
      name: "M_myList",
      component: M_myList
    },
    {
      path: "/modify_data",
      name: "Modify_data",
      component: Modify_data
    },
    {
      path: "/m_sign",
      name: "M_sign",
      component: M_sign
    },
    {
      path: "/m_map",
      name: "M_map",
      component: M_map
    },
    {
      path: "/m_stop",
      name: "M_stop",
      component: M_stop
    },
    {
      path: "/m_broker",
      name: "M_broker",
      component: M_broker
    },
    {
      path: "/m_contact",
      name: "M_contact",
      component: M_contact
    },
    {
      path: "/m_understand",
      name: "M_understand",
      component: M_understand
    },
    {
      path: "/m_service",
      name: "M_service",
      component: M_service
    },
    {
      path: "/m_manager",
      name: "M_manager",
      component: M_manager
    }
  ]
});
